﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:controls="clr-namespace:WinwiseARDrone.TabletClient.Controls">

    <Style TargetType="{x:Type controls:StickAnalogique}">
        <Style.Resources>
            <ImageBrush x:Key="StickAnalogiqueBackground" ImageSource="pack://application:,,,/WinwiseARDrone.TabletClient;component/Assets/FondStick01.png"/>
        </Style.Resources>
        
        <Setter Property="MinHeight" Value="110"/>
        <Setter Property="MinWidth" Value="110"/>
        <Setter Property="IsManipulationEnabled" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:StickAnalogique}">
                    <Canvas Background="{StaticResource StickAnalogiqueBackground}">
                        <Image x:Name="PART_ctlStick" 
                               Source="pack://application:,,,/WinwiseARDrone.TabletClient;component/Assets/Stick.png"
                               RenderTransformOrigin="0.5,0.5"
                               IsHitTestVisible="False">
                            <Image.RenderTransform>
                                <TranslateTransform X="-19" 
                                                    Y="-19"/>
                            </Image.RenderTransform>
                        </Image>
                    </Canvas>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="PART_ctlStick" Property="Source" Value="pack://application:,,,/WinwiseARDrone.TabletClient;component/Assets/StickTouch.png"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>